package com.zy.dp.simplefactory.example3;

public class Factory
{
	private static int count = 0;

	public static Api createApi()
	{
		Api api = null;
		if (count < 3)
		{
			api = new ImplA();
			count++;
		}

		else
		{
			api = new ImplB();
			count++;
		}

		return api;

	}

}
